#pragma once

#include <glm/glm.hpp>
#include <vector>

namespace teflon
{
    struct SimplePartile
    {
        glm::vec3 pos;
        glm::vec3 speed;
        glm::vec3 color;
        
        float decay_rate;
        float life;

    public:
        SimplePartile(const glm::vec3& pos, const glm::vec3& speed, const glm::vec3& color)
        {
            this->pos = pos;
            this->speed = speed;
            this->color = color;
            this->decay_rate = 0.01f;
            this->life = 1;
        }

        void Update(float dt)
        {
            if (life <= 0)
                return;

            pos += speed * dt;
            life -= decay_rate * dt;
        }
    };

    class ParticleSystem
    {
    private:
        std::vector<SimplePartile> particles;

    public:
        ParticleSystem();

        void Spawn();

        void Update(float dt);
    };
}
